-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Skips Namespace deletion on installlerSet deletion #565
Conversation
Previoulsy, if we delete an installerSet with Namespace eg pipelines it would delete ns too which means it would delete resources from other installerSet and the other installerSet will try to recreate it. so it might corrupt the resources. this update the installerSet to skip the deletion and update the owner of namespace to the owner of installerSet which means namespace will be deleted when TektonPipeline CR is deleted and not when its installerSet is deleted. this also updates the deletion flow in finalizer of TektonConfig. delete the resources in the reverse way of deletion. so delete platform specific first then triggers and then pipelines. Signed-off-by: Shivam Mukhade <[email protected]>
The following is the coverage report on the affected files.
|
if original.Spec.Profile == v1alpha1.ProfileLite { | ||
return pipeline.TektonPipelineCRDelete(ctx, r.operatorClientSet.OperatorV1alpha1().TektonPipelines(), v1alpha1.PipelineResourceName) | ||
} else { | ||
// TektonPipeline and TektonTrigger is common for profile type basic and all | ||
if err := pipeline.TektonPipelineCRDelete(ctx, r.operatorClientSet.OperatorV1alpha1().TektonPipelines(), v1alpha1.PipelineResourceName); err != nil { | ||
if err := trigger.TektonTriggerCRDelete(ctx, r.operatorClientSet.OperatorV1alpha1().TektonTriggers(), v1alpha1.TriggerResourceName); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this change 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to delete in the reverse order of resource creation
as deleting TektonPipeline will delete namespace
we delete dashboard, triggers and then pipelines
just to make all resource get deleted in a cleaner way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: pradeepitm12, vdemeester The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Previoulsy, if we delete an installerSet with Namespace eg pipelines
it would delete ns too which means it would delete resources from other
installerSet and the other installerSet will try to recreate it. so it
might corrupt the resources.
this update the installerSet to skip the deletion and update the owner of namespace to
the owner of installerSet which means namespace will be deleted when TektonPipeline CR
is deleted and not when its installerSet is deleted.
this also updates the deletion flow in finalizer of TektonConfig.
delete the resources in the reverse way of creation.
so delete platform specific first then triggers and then pipelines.
Signed-off-by: Shivam Mukhade [email protected]
Changes
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
See the contribution guide for more details.
Release Notes